package com.company.cloud.behavior.modules.jobHandler.mapper;

import com.company.cloud.behavior.modules.cache.models.BehaviorCountModel;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BehaviorCountMapper {

    @Select("select count(0) as count,obj_type,obj_no from base_user_collection_info " +
            "where rows_state = '1' group by obj_type, obj_no ")
    public List<BehaviorCountModel> getCollectionCount();

    @Select("select count(0) as count,obj_type,obj_no from base_user_comment_info " +
            "group by obj_type, obj_no ")
    public List<BehaviorCountModel> getCommentCount();

    @Select("select count(0) as count,obj_type,obj_no from base_user_follow_info " +
            "where rows_state = '1' group by obj_type, obj_no ")
    public List<BehaviorCountModel> getFollowCount();

    @Select("select count(0) as count,obj_type,obj_no from base_user_thumbs_up_info " +
            "where rows_state = '1' group by obj_type, obj_no ")
    public List<BehaviorCountModel> getThumbsUpCount();

    @Select("select count(0) as count,obj_type,obj_no from base_user_score_info " +
            "where rows_state = '1' group by obj_type, obj_no ")
    public List<BehaviorCountModel> getScoreCount();

    @Select("select AVG(score) as count,obj_type,obj_no from base_user_score_info " +
            "where rows_state = '1' group by obj_type, obj_no ")
    public List<BehaviorCountModel> getScoreAvg();

}
